<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>
    class Model{
        m1(){
            return "hello";
        }
        m2(){
            return "world";
        }
    }
    class View{
        v1(d){
            console.log(d);
        }
        v2(d){
            document.write(d);
        }
        v3(d){
            alert(d);
        }
    }
    class Control{
        constructor(){
            this.m = new Model();
            this.v = new View();
        }
        c1(){
            const d = this.m.m1();
            this.v.v2(d);
        }
        c2(){
            const d = this.m.m2();
            this.v.v1(d);
        }
        c3(){
            const d = this.m.m1();
            this.v.v3(d);
        }
        c4(){
            const d = this.m.m2();
            this.v.v3(d);
        }
        c5(){
            const d = this.m.m2();
            this.v.v2(d);
        }
    }

    
    const c = new Control()
    c.c5();

</script>
</html>